﻿// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com

// ReSharper disable CheckNamespace
// ReSharper disable CommentTypo
// ReSharper disable UnusedMember.Global
// ReSharper disable UnusedType.Global

/* ToolStripDropDownItemExtensions.cs -- методы расширения для ToolStripDropDownItem
 * Ars Magna project, http://arsmagna.ru
 */

#region Using directives

using System.Windows.Forms;

#endregion

#nullable enable

namespace AM.Windows.Forms.MarkupExtensions;

/// <summary>
/// Методы расширения для <see cref="ToolStripDropDownItem"/>.
/// </summary>
public static class ToolStripDropDownItemExtensions
{
    #region Public methods

    /// <summary>
    /// Добавление элементов в выпадающий список.
    /// </summary>
    public static TToolStripDropDownItem DropDownItems<TToolStripDropDownItem>
        (
            this TToolStripDropDownItem stripItem,
            params ToolStripItem[] items
        )
        where TToolStripDropDownItem: ToolStripDropDownItem
    {
        Sure.NotNull (stripItem);
        Sure.NotNull (items);

        stripItem.DropDownItems.AddRange (items);

        return stripItem;
    }


    #endregion
}
